Functions used during processing, such as computational functions, as well as others, may be implemented in hardware or software. If the function is implemented in hardware, as an instruction, for instance, then typically, any necessary exception detection and signaling are also implemented in hardware. Functions may also be implemented in software. If a software routine implements a function that could have been implemented in hardware, then the software routine may be said to “simulate” that hardware function.
Software routines do not have adequate control over hardware implemented exception handling. An exception is a condition that has been designated for special treatment. Examples of exceptions for floating point operations are shown in IEEE Std 754-1985, IEEE Standard For Binary Floating-Point Arithmetic; and in IEEE Std 854-1987, IEEE Standard for Radix-Independent Floating-Point Arithmetic, which are hereby incorporated herein by reference in their entirety. For example, a function may be provided to determine the square root of an operand. This operation may call for an exception if the operand is a negative number. If the routine was implemented in hardware, such exceptions may be handled by generating a machine interrupt that causes control to pass to an interrupt handling routine in the operating system. There is no mechanism available for the software routine to cause a hardware interrupt to occur in such a way that an interrupt handling routine could handle the interrupt as a software generated interrupt.